#define _CRT_SECURE_NO_WARNINGS 1

#include"string.h"

namespace bit
{
	void teststring1()
	{
		string s1("hello world");
		cout << s1.c_str() << endl;

		string::iterator it1 = s1.begin();
		while (it1 != s1.end())
		{
			cout << *it1 << " ";
			it1++;
		}
		cout << endl;


		for (auto e : s1)
		{
			cout << e;
		}
	}

	void teststring2()
	{
		string s1("hello world");

		s1.push_back('x');
		cout << s1.c_str() << endl;

		s1.append("x");
		cout << s1.c_str() << endl;

		s1.append("yyyyy");
		cout << s1.c_str() << endl;

		s1 += 'u';
		cout << s1.c_str() << endl;
		s1 += "zzzz";
		cout << s1.c_str() << endl;
	}

}

int main()
{
	//bit::teststring1();
	bit::teststring2();
	return 0;
}